var oper = getQueryString('oper')
var defId = getQueryString('id')

$(function () {
  // getDetail(defId)
  bpmInit({
    defId : defId,
    flowKey : '',
    instanceId : ''
  })
})

function getDetail(id) {
  $.operate.post(api + '/scabpm/bpm/instance/getInstanceData',
    {defId: id},
    function (res) {

      if (res.isOk){
        //iframe页面src复制
        $('#iframeContent').attr('src', res.data.form.formValue)

        //操作按钮循环显示
        buttonTemp(res.data.buttonList)

        configSpecified = res.data.configSpecified
      }else{
        $.modal.closeLoading();
      }


    }, false)
}

function submitHandler() {
  // var iframe = $('#applyIframe').contents()
  // console.log('获取iframe中的值',iframe.find('#name').val())
  window.frames["applyIframe"].window.submit()
}

function operateHandler(type) {
  var params = {
    action: type,
    businessKey: '',
    defId: defId,
    extendConf: {
      nodeId: '',
    },
    instanceId: '',
    option: '',
  }
}